<template>
  <div class="container">
    <div
      class="userStatus"
      v-if="this.userInfo.userStatus == 1||userStatus==10040||userStatus==10039"
    >
      <div>
        <img :src="disabelIcon" />
      </div>
      <div v-if="userStatus==10040">该用户已被禁用</div>
      <div v-else>该用户已被删除</div>
    </div>
    <Skeleton v-else />
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
import * as types from '@/store/mutation-types'
//10039,"该用户已被删除",10040,"该用户已被禁用",
export default {
  data: () => ({
    disabelIcon: require('IMG/public/disable_icon.png'),
    userStatus: 10040
  }),
  created() {
    this.userStatus = this.$route.query.userStatus

    if (this.userInfo.userStatus == 1 || this.userStatus == 10040 || this.userStatus == 10039) {
      let cropId = localStorage.getItem('cropId')
      localStorage.removeItem('awMasterUserInfo_sass_' + cropId)
      this.$store.commit('TABBAR', { show: false })
      return
    }
    console.log('public')
    console.log('yesdefaultPath')
    let defaultPath = localStorage.getItem('defaultPath')
    if (defaultPath) {
      localStorage.removeItem('defaultPath')
      // alert(defaultPath)
      this.$router.replace({ path: defaultPath })
    } else {
      console.log('nodefaultPath')
      // if (!this.userInfo.name || !this.userInfo.majorRegion || !this.userInfo.distributorName || !this.userInfo.institutionName) {
      //   this.$router.replace('/public/complete-info')
      // } else
      // if(this.userInfo.jumpToDynamicDetail == 1) {
      //   this.$router.push('/dynamics/allDynamics?allDynamicsNum=0')
      // }else {
      this.$router.replace('/write-article')
      // }
    }
  },
  methods: {},
  computed: {
    ...mapGetters(['userInfo'])
  },
  destroyed() {
    sessionStorage.removeItem('userStatus_10039')
    sessionStorage.removeItem('userStatus_10040')
  }
}
</script>
<style lang="less" scoped>
.container {
  display: flex;
  flex-direction: column;
  height: 100vh !important;
  bottom: 0;
  z-index: 1000;
  .userStatus {
    margin-top: 50%;
    text-align: center;
    color: #ddd;
    font-size: 14px;
    img {
      width: 100px;
      height: 100px;
    }
  }
}
</style>
